Global Const RASTERCAPS = 38 ' Raster device capabilities.
Global Const RC_PALETTE = &H100 ' Has palettes.
#If Win32 Then ' 32-bit VB.
Type BITMAP ' 24 bytes
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Global Const BITMAP_SIZE = 24
Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Integer, ByVal nIndex As Integer) As Integer
Declare Function GetSystemPaletteEntries Lib "gdi32" (ByVal hdc As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Declare Function RealizePalette Lib "gdi32" (ByVal hdc As Long) As Long
#Else ' 16-bit VB.
Type BITMAP ' 14 bytes
bmType As Integer
bmWidth As Integer
bmHeight As Integer
bmWidthBytes As Integer
bmPlanes As String * 1
bmBitsPixel As String * 1
bmBits As Long
End Type
Global Const BITMAP_SIZE = 14
Declare Function GetDeviceCaps Lib "GDI" (ByVal hdc As Integer, ByVal nIndex As Integer) As Integer
Declare Function GetSystemPaletteEntries Lib "GDI" (ByVal hdc As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
Declare Function GetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
Declare Function SetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
Declare Function GetObject Lib "GDI" (ByVal hObject As Integer, ByVal nCount As Integer, lpObject As Any) As Integer
Declare Function RealizePalette Lib "User" (ByVal hdc As Integer) As Integer